#! user/bin/python
# -*- coding: utf-8 -*-

"""
Created on 2021/8/20 12:14

@File: main.py
@Author: LT
@Description: 调用A.B.C的入口程序
"""
import os
import sys
import pprint

# ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓加上这一句就和unittest一样可以直接运行了
sys.path.append(os.path.dirname(os.path.dirname(__file__)))		# 这是顶级包所在的目录的绝对路径
# ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑

__package__ = os.path.dirname(__file__).split("\\")[-1]
# __package__ = 'project_1'         # 如果存在，相对导入将基于此属性而不是模块__name__属性。

print(f"\n\n\npackage is--->{__package__}    file name in package is--->{os.path.dirname(os.path.dirname(__file__))} __name__ is {__name__}\n\n\n")

from .栈的实现 import 简单的测时工具_timer as timer
from .集合的实现 import 普通集合类_set as set
from .集合的实现 import 优化_使用字典类型实现集合_fastset as fastset


def setops(Class):
    a = Class(range(50))
    b = Class(range(20))
    c = Class(range(10))
    d = Class(range(5))
    for i in range(5):
        t = a & b & c & d   # 取交集
        t = a | b | c | d   # 取并集


if __name__ == '__main__':
    rept = int(sys.argv[1])
    print("set=>", timer.test(rept, setops, set.Set))
    print("fastset=>", timer.test(rept, setops, fastset.Set))
    pass